#ifndef _SYS_ENUM_H_
#define _SYS_ENUM_H_

#include "FanObj.h"
#include "SysTypes.h"

#define ENUM_VTABLE(self)   ((EnumVTable*)((FanObj*)self)->vtable)


extern Type*    Enum_classType;
extern VTable*  Enum_classVTable;


/* [sys::Enum] Attributes */
struct Enum
{
  FanObj        super;
};


/* [sys::Enum] Virtual-table */
typedef struct EnumVTable
{
  FanObjVTable  super;
} EnumVTable;


/* [sys::Enum] Methods and fields */
void            Enum_make(Enum* self, Int ordinal, Str* name);
Bool            Enum_equals(Obj self, NullableObj obj);
Int             Enum_compare(Obj self, Obj obj);
Str*            Enum_toStr(Obj self);
Enum*           Enum_doFromStr(Type* t, Str* name, Bool checked);
Str*            Enum_name(Enum* self);
Int             Enum_ordinal(Enum* self);


/* [sys::Enum] Type-system functions */
Type*           Enum_initType(void);
VTable*         Enum_initVTable(void);
void            Enum_initStatic(void);


#endif
